package com.ygqh.baby.service;

import java.util.Date;
import java.util.List;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.ao.TaskMethod;
import com.ygqh.baby.po.YgTaskTime;

public interface YgTaskTimeService {

	List<YgTaskTime> find();

	List<YgTaskTime> findByName(String methodName);

	int findCount();

	YgTaskTime findById(Long id);

	int save(YgTaskTime ygTaskTime);

	int update(YgTaskTime ygTaskTime);

	int saveOrUpdate(YgTaskTime ygTaskTime);

	ResultSet<YgTaskTime> search(QueryInfo queryInfo, String q);

	YgTaskTime findLastByTaskMethod(TaskMethod method);

	int updateTaskTime(Long id, TaskMethod methodName, Date currentTime, String remark);

	int saveOrUpdate(String methodName, Date date, String remark);

	/**
	 * 自动执行
	 * 
	 * @param methodName
	 * @param template
	 * @throws Exception
	 */
	void autoExecute(String methodName, YgTaskTimeTemplate template);

	void execute(TaskMethod methodName, int timeInterval, YgTaskTimeTemplate template);
}
